/**
 * 
 */
package org.t2.game.server.module.data.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.t2.game.server.module.data.model.Data;

/**
 * @author YY
 */
public abstract class DataParserService {
	
	private static Map<String, DataParserService> serviceMap = new HashMap<>();
	public static DataParserService getService(String dataType) {
		return serviceMap.get(dataType);
	}
	
	public DataParserService() {
		serviceMap.put(dataType(), this);
	}
	
	public abstract String dataType();
	
	/**
	 * @param playerId 玩家ID
	 * @param plaintext 明文数据
	 */
	public abstract void parser(long playerId, List<Data> datas, String reason);
}
